<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>for,while,do...while循环</title>

<script type="text/javascript">
	/* for循环 */
	var str="9";		
	for(i=0;i<4;i++){
		str="0"+str;
	}
	document.write(str+" ");
	
	/* while循环 */
	var i=0;
	var str="9";
	while(i<4){
		str="0"+str;
		i++;
	}
	document.write(str+" ");
	
	/* do...while循环 */
	var i=0;
	var str="9";
	do{
		str="0"+str;
		i++；
	}while(i<4);
	document.write(str+" ");
</script>
</head>
<body>

</body>
</html>